﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Yala.Models" namespace="Yala.Models.Users">
  <class name="User" table="Users">
    <id name="Id" column="UserId" type ="System.Guid" />    
    <property name="Username" column="UserName" type="string" not-null="false" />
    <property name="Email" column="Email" type="string" not-null="true" />    
    <property name="OpenId" column="OpenId" type="string" not-null="true" />    
    <property name="LastLogOnDate" column="LastLogOnDate" type="System.DateTime" not-null="true" />
    <many-to-one name="AuthProvider" column ="AuthProviderId" class="Yala.Models.AuthProviders.AuthProvider"  not-null="true" />
    <set name="Items" generic="true" inverse="true" >
      <key column="OwnerId" not-null="true"/>
      <one-to-many class="Yala.Models.Items.Item"/>
    </set>
    <one-to-one name="UserProfile" class="Yala.Models.UserProfiles.UserProfile"/>
    
	  <!--<join table ="UserProfiles">
		  <key column="UserId" />
		  <property name="FirstName" column="FirstName" type="string" not-null="false" />
		  <property name="MiddleName" column="MiddleName" type="string" not-null="false" />
		  <property name="LastName" column="LastName" type="string" not-null="false" />		  
	  </join>-->
  </class>  
</hibernate-mapping>